package com.endurance.service;

import com.endurance.dao.AnnotationDao;
import com.endurance.dao.impl.AnnotationDaoImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class AnnotationService {

    @Value("小琳")
    private String name;

    @Value("中国！")
    private String address;

    @Autowired
    private AnnotationDaoImpl annotationDaoImpl;

    @Autowired
    @Qualifier("annotationDaoImpl1")
    private AnnotationDao annotationDao;

    @Resource(name = "annotationDaoImpl2")
    private AnnotationDao annotationDaoImpl1;

    @Override
    public String toString() {
        return "AnnotationService{" +
                "name='" + name + '\'' +
                ", address='" + address + '\'' +
                ", annotationDaoImpl=" + annotationDaoImpl +
                ", annotationDao=" + annotationDao +
                ", annotationDaoImpl1=" + annotationDaoImpl1 +
                '}';
    }
}
